home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / tcp / amitcp / amitcp-src-22.lha / AmiTCP-2.2 / src / appl / napsaterm / display.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-07  |  6.0 KB  |  165 lines

  1. /* display.h -- defines for niftyterm display routines
  2.  *
  3.  * (C) Copyright 1988, Chris Newman
  4.  * All Rights Reserved
  5.  * Permission is granted ot copy, modify, and use this as long
  6.  * as this notice remains intact.  This is a nifty program.
  7.  *
  8.  * $Author: CN/TW $ $Revision: 1.2 $ $Date: 1991/04/23 00:00:00 $
  9.  */
  10.  
  11. /* globals:
  12.  * int emulation;            the current emulation mode
  13.  * int vt100_yucky_wrap_mode;    emulator sets this to 0 when non-graphic character input
  14.  *                is received.
  15.  * int ansi_LNM;            ansi line feed/new line mode. if set, CR=CR,LF
  16.  */
  17.  
  18. /* emulation types -- stored in global int emulation */
  19. #define    EMU_VT102   0    /* similar to ANSI -- may be software switched to VT52 */
  20. #define    EMU_VT52    1    /* may be switched by software to VT102 */
  21. #define    EMU_H19        2    /* codes from h19 program */
  22.  
  23. /* types for dsstyle */
  24. #define    BOLD1        1
  25. #define    BOLD0        2
  26. #define    ITALIC1        3
  27. #define    ITALIC0        4
  28. #define    UNDERLINE1    5
  29. #define    UNDERLINE0    6
  30. #define    INVERSE1    7
  31. #define    INVERSE0    8
  32. #define    HALFBRITE1    9
  33. #define    HALFBRITE0    10
  34. #define    BLINK1        11
  35. #define    BLINK0        12
  36. #define    BLANK1        13
  37. #define    BLANK0        14
  38. #define    ALTERNATE1    15
  39. #define    ALTERNATE0    16
  40. #define    DWIDTH1        17
  41. #define    DWIDTHTOP    18
  42. #define    DWIDTHBOT    19
  43. #define    DWIDTH0        20
  44. #define    STYLESOFF    255
  45. /* these are used internally to display.c */
  46. #define    SAVE_STYLE    256
  47. #define    RESTORE_STYLE    257
  48.  
  49. /* types for dscursormove */
  50. #define    CURSOR_UP        1
  51. #define    CURSOR_DOWN        2
  52. #define    CURSOR_LEFT        3
  53. #define    CURSOR_RIGHT        4
  54. #define    BEGIN_LINE        5
  55. #define    END_LINE        6
  56. #define    NEXT_LINE        7
  57. #define    BOTTOM_HOME        8
  58. #define    SAVE_CURSOR        9
  59. #define    RESTORE_CURSOR        10
  60. #define    INDEX            11
  61. #define DOWN1_AND_SCROLL    12
  62. #define    REVERSE_INDEX        13
  63. #define    INSERT_LINE        14
  64. #define    DELETE_LINE        15
  65. #define    INSERT_CHAR        16
  66. #define    TAB_STOP        17
  67.  
  68. /* types for dsfunction */
  69. #define    ERASETO_EOL        1
  70. #define    ERASETO_EOS        2
  71. #define    ERASETO_SOL        3
  72. #define    ERASETO_SOS        4
  73. #define    ERASE_LINE        5
  74. #define    RESET_DISPLAY        6
  75. #define    SCROLL_UP        7
  76. #define    SCROLL_DOWN        8
  77. #define    ORIGIN_ON        9
  78. #define    ORIGIN_OFF        10
  79. #define    BLOCK_CURSOR        11
  80. #define    UNDERLINE_CURSOR    12
  81. #define    INVISIBLE_CURSOR    13
  82. #define VISIBLE_CURSOR        14
  83. #define    WRAP_ON            15
  84. #define    WRAP_OFF        16
  85. #define    INSERT_ON        17
  86. #define    INSERT_OFF        18
  87. #define    SET_TAB            19
  88. #define    CLEAR_TAB        20
  89. #define    CLEAR_ALL_TABS        21
  90.  
  91. /* types for dsinvert */
  92. #define    INVERT_ON        1
  93. #define    INVERT_OFF        2
  94. #define    VISUAL_BELL        3
  95.  
  96. /* commands for dskeyboard */
  97. #define DS_AUTOREPEAT        1    /* on if val is true */
  98. #define DS_LEDS            2   /* val is bit pattern */
  99. #define DS_KEYCLICK        3    /* on if val is true */
  100. #define DS_CURSORMODE        4   /* modes for the cursor keys */
  101. #define DS_KEYPADMODE        5   /* modes for the numeric keypad */
  102. #define DS_KEYPADAPPMODE    6   /* on if val is true */
  103.  
  104. /* arguments for dskeyboard cursor modes */
  105. #define CURSOR_VT100          0    /* vt100 cursor key mode */
  106. #define CURSOR_ANSI        1    /* ansi cursor key mode */
  107. #define CURSOR_VT52        2    /* vt52 cursor key mode */
  108.  
  109. /* arguments for dskeyboard keypad modes */
  110. #define KEYPAD_ANSI        0    /* ansi numeric */
  111. #define KEYPAD_VT52        2    /* vt52 numeric */
  112. #define KEYPAD_H19        4    /* h19 numeric */
  113. #define KEYPAD_H19S        6    /* h19 shifted numeric */
  114. #define KEYPAD_H19ANSI        8    /* h19 ansi numeric */
  115. #define KEYPAD_H19SANSI        10  /* h19 shifted ansi numeric */
  116.  
  117. /* niftyterm interface to a display & input manager:
  118.  *******************************************
  119.  * Display Generic Routines:
  120.  *******************************************
  121.  * dscursormove(int mv);            --  see list of moves above
  122.  * dsfunction(int what);            --  see list of functions above
  123.  * dsgetcursor(int *x, *y);            --  get the current cursor position
  124.  * dscursorto(int x, y);            --  set the current cursor position
  125.  * dsprintf(char *fmat, ...);            --  print formatted output
  126.  * dssetscroll(top,bottom);            --  set the scrolling region
  127.  * dsgetsize(int *maxx, *maxy);            --  get the size of the window
  128.  * int dscheckdown();                --  returns 0 if cursor on bottom line, otherwise
  129.  *                        --  moves cursor down a line and returns new line number.
  130.  *
  131.  *******************************************
  132.  * Display Specific Routines:
  133.  *******************************************
  134.  * dsinit();                --  initialize display options
  135.  * dsstart(char *progname);        --  starts the display, progname for title bars
  136.  * dsquit();                --  clean up window & IO files
  137.  * dsshowusage();            --  show additional switches for display
  138.  * int dsparsearg(c, cont, next);    --  parse a command line switch:
  139.  *                    --  c = option, cont = rest of option, next = next arg
  140.  *                    --  return: 0: invalid, 1: continue, 2: next used
  141.  * int dsfillbuf(buf, len, mask);    --  fills buf with up to len bytes from file descriptors in mask
  142.  * int dsinputmask();            --  returns a file pointer mask for input to be sent to tty
  143.  * int dsstyle(s);            --  change the style (see #defines above)
  144.  *                    --  return: 0 if ok, -1 if unavailable
  145.  * int dscheckredraw(redraw);        --  checks for a redraw, does flash, and sets delay timer
  146.  *                    --  <0: Window close, =0: nothing, >0: redraw
  147.  * dstestscreen();            --  fill display with E's for testing purposes.
  148.  * dsdelete(n);                --  delete n characters from under the cursor
  149.  * dsputs(char *string);        --  put a string of characters to the display.
  150.  * dsclearscreen();            --  high speed clear of entire screen
  151.  * dsclear(int x, y, x1, y1);        --  clear a rectangular region
  152.  * dsscroll(int y, numlines, amount);    --  scroll a region
  153.  * dsinvert();                --  see types above
  154.  * dscursoron();            --  cursor on, and flush output
  155.  * dscursoroff();            --  cursor off
  156.  * dskeyboard(cmd, val);        --  keyboard functions
  157.  * dsothermask();            --  returns a file pointer mask for input to be sent to display
  158.  * dsotherfillbuf(buf, len, mask);    --  like dsfillbuf, but for input that goes directly to display
  159.  *
  160.  *******************************************
  161.  * Internal Display Specific Routines:
  162.  *******************************************
  163.  * idssetfont(short attribs,int line);        --  set the appropriate font for given attribs & line
  164.  */
  165.